1. Field of the Invention
The present invention relates to a data processing apparatus and method characterized by the method of management of a buffer provided in a decoding device and to an encoding device.
2. Description of the Related Art
There is a system of transmitting encoded video data and audio data via a network etc. or recording the same on a recording medium such as a digital versatile disk (DVD) and providing the same to a decoding device. The decoding device of such a system temporarily writes the input data into the buffer and then reads out and decodes the same.
The buffer provided in the decoding device has a limited storage capacity, and the quality of the decoded output deteriorates when the buffer underflows. Therefore, the encoding device adds delay time information indicating the time from when the frame data is written into the buffer to the time when it is read out (delay time) to the inside of the video data and the audio data in units of for example the frame data composing the video data and audio data so that the buffer will not overflow or underflow.
Conventionally, for example as shown in FIG. 14, the timing for writing encoded stream data EBI into a buffer E_BUF of the encoding device, the timing for writing encoded stream data DBI into a buffer D_BUF of the decoding device, and the timing for reading the encoded stream data DBO from the buffer D_BUF to the decoding circuit are prescribed. When transmitting the encoded stream data DBI via the network, the timing for writing the encoded stream data DBI into the buffer D_BUF of the decoding device approximately coincides with the timing for reading for example the encoded stream data DBI from the buffer E_BUF of the encoding device.
Conventionally, when determining the delay time of each frame data composing the encoded stream data DBI, a sufficient margin not allowing underflow of the buffer D_BUF is imparted to the delay time without considering the size of the frame data to be decoded after the frame data. As related art, see the specification of U.S. Pat. No. 5,511,054.
For this reason, the decoding device of the conventional system has the problems that the delay time is long, that is, a long time is taken from the reception of the frame data from the encoding device to actual decoding of the frame data, so the response is poor. For this reason, there is the problem that a large storage capacity is required for the buffer D_BUF.